package com.dd.common.dto.system.file.folder;

import com.dd.common.pojo.dto.TimeDTO;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.Min;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

@Schema(description = "文件管理文件夹查询DTO")
@Data
public class SysFileFolderQueryDTO extends TimeDTO implements Serializable {
    @Schema(description = "父文件夹ID", example = "1")
    @Min(value = 1, message = "ID必须是正整数")
    private Long parentId;

    @Schema(description = "文件夹名称", example = "用户头像")
    private String folderName;

    @Schema(description = "文件夹标识符", example = "avatar")
    @Pattern(regexp = "^[a-zA-Z_][a-zA-Z0-9_]*$", message = "文件夹标识符只能包含字母、数字、下划线，且不能以数字开头")
    private String folderKey;

    @Schema(description = "状态（1-正常，0-禁用）", example = "1")
    @Range(min = 0, max = 1, message = "状态值只能是0或1")
    private Integer status;
}
